<template>
  <div>
      <van-search
  v-model="kw"
  shape="round"
  background="pink"
  placeholder="请输入搜索关键词"
/>
    <!-- <input type="text" v-model="kw" /> -->
      <div>
        <good-list :arr="arr"></good-list>
    </div>
 
  </div>
</template>
<script>
import {gosearch} from "../../http/http"
export default {
    data() {
        return {
            kw:'',
            arr:[]
        }
    },
    watch:{
        kw(){
            if(this.kw==""){
                this.arr=[];
                return;
            }
         
    gosearch(this.kw).then(res=>{
                console.log(res);
                this.arr=res.data.list?res.data.list:[]
            })
        }
    }
}
</script>